package mars;

public class Plateu {
	
	private static Plateu plateu = null;
	private Position topRight;
	private Position bottomLeft;
	
	private Plateu() {
		topRight = null;
		bottomLeft = null;
	}
	
	public static Plateu getInstance() {
		if(plateu == null) {
			plateu = new Plateu();
		}
		return plateu;
	}

	public Position getTopRight() {
		return topRight;
	}

	public void setTopRight(Position topRight) {
		this.topRight = topRight;
	}

	public Position getBottomLeft() {
		return bottomLeft;
	}

	public void setBottomLeft(Position bottomLeft) {
		this.bottomLeft = bottomLeft;
	}
	
	public boolean checkBoundsCondition(int x, int y) {
		if(x > topRight.getX() || y > topRight.getY()) {
			return false;
		} else if(x < bottomLeft.getX() || y < bottomLeft.getY()) {
			return false;
		}
		return true;
	}
}
